package homework;

public class Student {
	String name;
	String subject;
	double grade;
	int yearInCollege;
	int age;
	boolean isDegree;
	double money;
	
	Student() 
	{
		grade = 4.0;
		yearInCollege = 1;
		isDegree = false;
		money = 0.0;
	}
	Student(String name, String subject, int age)
	{
		this();
		this.name = name;
		this.subject = subject;
		this.age = age;
	}
	
	void upYear()
	{
		if(yearInCollege<4)
			yearInCollege++;
		else {
			isDegree = true;
			System.out.println("The student is graduated! ");
		}
	}
	double receiveScholarship(double min, double amount)
	{
		if(this.grade>=min && this.age<30)
		{
			this.money+=amount;
		}
		return this.money;
	}
	void printStudent()
	{
		System.out.println("Student's name: " + this.name);
		System.out.println("Student's subject: " + this.subject);
		System.out.println("Studet's grade: " + this.grade);
		System.out.println("Student's age: " + this.age);
		System.out.println("Year in college: " + this.yearInCollege);
		System.out.println("Is student degree? " + this.isDegree);
		System.out.println("Student's amount of money: " + this.money);
		System.out.println();
		
	}


}
